from __future__ import division
from scipy.stats import rv_continuous
from numpy import e, sqrt, pi

class gaussian_gen(rv_continuous):
    " Gaussian distribution"
    mu  = 0
    sigma = 25 

    def _pdf(self, x):
        mu = self.mu 
        sigma = self.sigma

        z = (x-mu)/sigma 
        exp = e**(-0.5*z**2)  
        C = sqrt(2*pi)*sigma 
        return exp/C 

mygaussian = gaussian_gen(a=-100, b=100, name='my_gauss')
if __name__ == '__main__':
    import matplotlib.pyplot as plt
    from numpy import linspace 
    t = linspace(-100,100,100)
    plt.plot(t, 3*mygaussian.pdf(t))
    plt.show()
    print(mygaussian.pdf(0))
